package com.ihunanren.weixin.module.screen.school;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.ihunanren.biz.weixin.ao.ISchoolCurriculumAO;
import com.ihunanren.biz.weixin.domain.school.SchoolCurriculumModify;
import com.ihunanren.dao.pojo.SchoolCurriculumDefinedDO;
import com.ihunanren.webx.UserTrackInfo;

public class Modify {

	@Autowired
	private HttpServletRequest request;
	@Autowired
	private ISchoolCurriculumAO schoolCurriculumAO;
	public void execute(Navigator nav, Context context) {
		
		UserTrackInfo trackInfo = new UserTrackInfo(request);
		if(!trackInfo.isLogin()){
			nav.forwardTo("/school/login");
			return;
		}else{
			SchoolCurriculumDefinedDO definedDO = schoolCurriculumAO.getSchoolCurriDefinedById(trackInfo.getUserDefinedId());
			SchoolCurriculumModify modify = new SchoolCurriculumModify(definedDO);
			context.put("modify", modify);
		}
	}
}
